package antlr.caculator.app;

public class CaculatorUtil {
    public static int getRetainNum(Object left,Object right){
        if(left!=null&&right!=null){
            int leftLen = 0;
            int rightLen = 0;
            if(left instanceof Double){
                leftLen = left.toString().substring(left.toString().indexOf("."), left.toString().length()-1).length();
            }
            if(right instanceof Double){
                rightLen = right.toString().substring(right.toString().indexOf("."), right.toString().length()-1).length();
            }
            return leftLen>rightLen?leftLen:rightLen;
        }
        return 0;
    }
}
